Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

canvas-confetti

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

canvas-confetti

performant confetti animation in the browser

  • 1.9.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created

What is canvas-confetti?

canvas-confetti is a lightweight JavaScript library for creating fun and customizable confetti animations on HTML canvas elements. It is easy to use and provides a variety of options to control the appearance and behavior of the confetti.

What are canvas-confetti's main functionalities?

Basic Confetti

This feature allows you to create a basic confetti animation with default settings. It is the simplest way to add confetti to your web page.

const confetti = require('canvas-confetti');
confetti();

Customizable Confetti

This feature allows you to customize the confetti animation by specifying parameters such as particle count, spread, and origin. This gives you more control over the appearance and behavior of the confetti.

const confetti = require('canvas-confetti');
confetti({
  particleCount: 100,
  spread: 70,
  origin: { y: 0.6 }
});

Confetti with Shapes

This feature allows you to create confetti with different shapes and colors. You can specify an array of shapes and colors to create a more diverse and visually appealing confetti animation.

const confetti = require('canvas-confetti');
confetti({
  particleCount: 100,
  shapes: ['circle', 'square'],
  colors: ['#bb0000', '#ffffff']
});

Fireworks Effect

This feature allows you to create a fireworks-like confetti effect by adjusting parameters such as particle count, spread, and start velocity. This creates a more dynamic and exciting animation.

const confetti = require('canvas-confetti');
confetti({
  particleCount: 200,
  spread: 160,
  startVelocity: 30,
  origin: { y: 0.7 }
});

Other packages similar to canvas-confetti

Keywords

FAQs

Package last updated on 30 Apr 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc